<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <include file="./Public/Admin/header.html" />
    <style>
        .row-fluid [class*="span"]{margin-left:0px;margin-bottom:10px;}
    </style>
</head>
<body>
<body>
<div id="main">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="box">
                    <div class="box-title">
                        <div class="span4">
                            <h3><i class="icon-table"></i>分组用户管理——{$groupname}</h3>
                        </div>

                    </div>
                    <div class="box-content">
                        <div class="row-fluid">
                            <div class="span12 control-group">
                                <div class="pull-left">
                                    <button class="btn" title="批量删除"  attr='BatchDelInfo'><i class="icon-remove"></i>批量删除</button>
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid dataTables_wrapper" >
                            <table id="listTable" class="table table-bordered table-hover  dataTable">
                                <thead>
                                <tr>
                                    <th class='with-checkbox'>
                                        <input type="checkbox" class="check_all" /></th>
                                    <th>头像</th>
                                    <th>昵称</th>
                                    <th>性别</th>
                                    <th>地址</th>
                                    <th>关注时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="users" item="item">
                                <tr>
                                    <td class="with-checkbox">
                                        <input type="checkbox" name="check" value="{$item.id}">
                                    </td>
                                    <td style="text-align:left;">
                                        <if condition="$item.headimgurl!=''">
                                            <p><img src="{$item.headimgurl}" style="max-width:60px;max-height:60px; "></p>
                                        </if>
                                    </td>
                                    <td>{$item.nickname}</td>
                                    <td>
                                        <if condition="$item.sex == 1">
                                            男
                                            <elseif condition="$item.sex == 2"/>
                                            女
                                            <else/>
                                            未知
                                        </if>
                                    </td>
                                    <td>{$item.country}{$item.province}{$item.city}</td>
                                    <td>{$item.subscribe_time|date="Y-m-d H:i:s",###}</td>
                                    <td class='hidden-480'>
                                        <a href="javascript:void(0);" class="btn" rel="tooltip" title="删除" attr="del*text*{$item.id}"><i class="icon-remove"></i>删除</a>
                                    </td>
                                </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        //删除内容
        $("a[attr^='del*text*']").click(function(){
            var tmp = $(this).attr('attr').split('*');
            var ids = new Array();
            ids[0]=tmp[2];
            delText(ids);
        });
        $("[attr='BatchDelInfo']").click(function(){
            var check = $("input:checked");
            if(check.length<1){
                alert('请选择删除项');
                return false;
            }
            var ids = new Array();
            check.each(function(i){
                ids[i] = $(this).val();
            });
            delText(ids);
        });
    });
    //删除内容
    function delText(ids){
        G.ui.tips.confirm_flag('您确定要删除吗?',function(){
            var group_id="{$group_id}";
            $.post("{:U('Admin/Wechat/del_gp_user')}", {ids:ids,group_id:group_id},function(data){
                if (data.errno ==0)
                {
                    location.reload();
                } else {
                    G.ui.tips.err(data.error);
                }
            },'json');
        });
    }
</script>
</body>
</html>
